package com.xingdian.xingdianhulianweb.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class RequestController {

    @RequestMapping("/")
    public String ok3(){
        return "index";
    }

/*
    @RequestMapping("/hk")
    public String HK(){
        return "hk";
    }
*/

    @RequestMapping("/Brand/Intro")
    public String ok1(){
        return "intro";
    }

    @RequestMapping("/index")
    public String ok6(){
        return "index";
    }

    @RequestMapping("/Brand")
    public String ok2(){
        return "intro";
    }

    @RequestMapping("/Brand/History")
    public String ok4(){
        return "brand_history";
    }

    @RequestMapping("/Brand/Founder")
    public String ok5(){
        return "founder";
    }

    @RequestMapping("/Product")
    public String product1(Model model,String Node){
        if(Node==null||Node.equals("200900100")){
            model.addAttribute("Node","200900100");
            return "product8";
        }
        if(Node.equals("200900200")){
            model.addAttribute("Node","200900200");
            return "product8";
        }
        if(Node.equals("200900400")){
            model.addAttribute("Node","200900400");
            return "product8";
        }
        if(Node.equals("200900500")){
            model.addAttribute("Node","200900500");
            return "product8";
        }
        if(Node.equals("200900800")){
            model.addAttribute("Node","200900800");
            return "product8";
        }
        if(Node.equals("200901000")){
            model.addAttribute("Node","200901000");
            return "product8";
        }
        if(Node.equals("200901500")){
            model.addAttribute("Node","200901500");
            return "product8";
        }
        model.addAttribute("Node","200901300");
        return "product8";
    }

    @RequestMapping("/Ip")
    public String Ip(Model model,String Node){
        if(Node==null||Node.equals("200900100")){
            model.addAttribute("Node","200900100");
            return "ips";
        }
        if(Node.equals("200900200")){
            model.addAttribute("Node","200900200");
            return "ips";
        }
        if(Node.equals("200900400")){
            model.addAttribute("Node","200900400");
            return "ips";
        }
/*        if(Node.equals("200900500")){
            model.addAttribute("Node","200900500");
            return "ips";
        }
        if(Node.equals("200900800")){
            model.addAttribute("Node","200900800");
            return "ips";
        }
        if(Node.equals("200901000")){
            model.addAttribute("Node","200901000");
            return "ips";
        }
        if(Node.equals("200901500")){
            model.addAttribute("Node","200901500");
            return "ips";
        }*/
        model.addAttribute("Node","200901300");
        return "ips";
    }

    @RequestMapping("/Shop")
    public String shop1(){
        return "map";
    }

    @RequestMapping("/News")
    public String news(){
        return "news";
    }

    @RequestMapping("/News/Details")
    public String details(Integer id){
        if(id == 1||id==5||id==6||id==7||id==8){
            return "details";
        }
        if(id==5){
            return "details";
        }
        if(id == 14){
            return "details2";
        }
        return "details3";
    }

    @RequestMapping("/Map")
    public String shop2(){
        return "map";
    }

    @RequestMapping("/Shop/result")
    public String shop4(){
        return "product4";
    }

    @RequestMapping("/Shop/Stroe")
    public String shop3(){
        return "store";
    }

    @RequestMapping("/Contact/Supplier")
    public String supplier(){
        return "supplier";
    }

    @RequestMapping("/Contact")
    public String contact(){
        return "contact";
    }

}
